import * as PIXI from 'pixi.js'

const icons: { [key: string]: Wx.Sprite.Coord } = {
  search: [0, 0, 35, 35],
}
const bundle = await PIXI.Assets.loadBundle('icons')
/**获取图标精灵 */
export default (name: string): PIXI.Sprite => {
  return new PIXI.Sprite(
    new PIXI.Texture({
      source: new PIXI.Texture(bundle.icons).source,
      frame: new PIXI.Rectangle(...icons[name]),
    }),
  )
}
